<template>
  <footer class="footer">
    <span class="todo-count">剩余<strong>数量值</strong></span>
    <ul class="filters">
      <li>
        <!-- 设置动态类名，当type等于他们传递的参数的时候为true显示样式 -->
        <a :class="{selected :type==='all'} " href="javascript:;" @click="$emit('changeType','all')" >全部</a>
      </li>
      <li>
        <a  :class="{selected :type==='no'}" href="javascript:;" @click="$emit('changeType','no')">未完成</a>
      </li>
      <li>
        <a  :class="{selected :type==='yes'}" href="javascript:;"  @click="$emit('changeType','yes')">已完成</a>
      </li>
    </ul>
    <button class="clear-completed" @click="$emit('removeFinished')" >清除已完成</button>
  </footer>
</template>

<script>
export default {
props: ['type']
}
</script>